// JavaScript Document

jQuery.fn.center = function (b_px) {
	
	var new_width = ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() ;
	if ( new_width < 0 ) new_width = 0;
	
	var new_top = ( $(window).height() - this.height() - b_px ) / 2+$(window).scrollTop();
	if ( new_top < 0 ) new_top = 0;
	//alert(new_width)
	this.css('top', new_top + 'px');
	this.css('left', new_width +  'px');
	
	return this;
}

// Close Button //
function close_win(){
	var nvua = navigator.userAgent;
		if(nvua.indexOf('MSIE') >= 0){
			if(nvua.indexOf('MSIE 5.0') == -1) {
				top.opener = '';
			}
		}
		else if(nvua.indexOf('Gecko') >= 0){
			top.name = 'CLOSE_WINDOW';
			wid = window.open('','CLOSE_WINDOW');
		}
	top.close();
}